﻿using Lg.Core.DbHelper;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lg.Core.Extensions.DbHelper
{
    internal static class DBParameterExtensions
    {
        /// <summary>
        /// 将List<DbParam>转换成List<SqlParameter>
        /// </summary>
        /// <param name="listDBParams"></param>
        /// <returns></returns>
        public static List<SqlParameter> ToListSqlParam(this List<DBParameter> listDBParams)
        {
            List<SqlParameter> listParam = new List<SqlParameter>();
            foreach (var p in listDBParams)
            {
                listParam.Add(new SqlParameter(p.ParameterName, p.Value));
            }
            return listParam;
        }

       
    }
}
